package web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entity.Cinema;
import entity.Movie;
import service.ServiceMovie;
import service.ServiceMovieImpl;


@WebServlet("/MovieActionShowAll")
public class MovieActionShowAll extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//1、获取参数，本例没有
		
		//2、通过service取得数据
		ServiceMovie serviceMovie = new ServiceMovieImpl();
		List<Movie> jjsyList = serviceMovie.StatusAll();
		List<Movie> zzryList = serviceMovie.Status1All();
		List<Cinema> cinemaList = serviceMovie.CinemaAll();
		//3、跳转到jsp，显示结果
		request.setAttribute("zzryList", zzryList);
		request.setAttribute("jjsyList", jjsyList);
		
		request.setAttribute("cinemaList", cinemaList);
		request.getRequestDispatcher("IndexShow.jsp").forward(request, response);


	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
